package main

import "fmt"

func main() {
	a,b,c := A()
	fmt.Println(a,b,c)
	B(3,4,5)

	a1 :=func(){
		fmt.Println("func a1")
	}
	a1()
	f:=C(10)
	fmt.Println(f(20))
	fmt.Println(f(2))
	for i:=0; i<3;i++{
		defer fmt.Println(i)
	}

	for i:=0; i<3;i++{
		defer func(){
			fmt.Println(i)
		}()
	}
}

func A()(a,b,c int){
	a, b, c = 1,2,3
	return a,b,c
}

func B(a ...int){
	fmt.Println(a)
}

func C(x int) func(int) int{
	return func(y int) int{
		return x+y
	}
}
